<?php
 class ApiCenter_ProductApi_Model_Api2_Product_Setcategory_Rest extends ApiCenter_ProductApi_Model_Api2_Product_Setcategory{
     
     /**
      * 查询所有的category及所有子集
      * */
     public  function _queryAllCategory($parent_id=2){
            $collection = Mage::getModel('catalog/category')->getCollection();

             $collection->addFieldToFilter('parent_id',array('gteq' => array($parent_id)));
			 $collection->getSelect()
					->joinLeft(array('f' => 'catalog_category_entity_varchar'),
                       'e.entity_id = f.entity_id',
                       array(
                           "text"=>"f.value",
                       ))
					 ->where("f.attribute_ID = 41 AND f.store_id = 0");
					
					return $collection;
            
     }
     
 }